//
//  PxRequestHelper.h
//  PxHelper
//
//  Created by lpc on 2019/10/18.
//  Copyright © 2019 lpc. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 回调block

 @param response Response
 @param data Response data
 @param error Reponse error
 */
typedef void (^PxHttpResponseBlock) (NSData *data, NSURLResponse *response, NSError *error);

/**
 Header配置block

 @param headers Headers
 */
typedef void (^PxGHttpConfigBlock) (NSMutableDictionary *headers);

NS_ASSUME_NONNULL_BEGIN

@interface PxRequestHelper : NSObject

+ (void)postToUrl:(NSURL *)url
           params:(NSDictionary *)params
       completion:(PxHttpResponseBlock)completion;

+ (void)getWithUrl:(NSURL *)url
            params:(NSDictionary *)params
        completion:(PxHttpResponseBlock)completion;

@end

NS_ASSUME_NONNULL_END
